package cn.as132.controller;

import cn.as132.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/emp")
public class EmpController {
    @Autowired
    EmpService empService;

    /**
     * 查询所有新闻
     * @param model
     * @param pageNo
     * @return
     */
    @RequestMapping("findall")
    public String findAll(Model model, Integer pageNo) {
        if (null == pageNo) {
            pageNo = 1;
        }
        model.addAttribute("pageUtil", empService.findAll(pageNo,3));
        return "showEmp";//逻辑视图名称
    }
}
